package com.butterfly.hotkey.core.model;


import cn.hutool.core.date.SystemClock;

/**
 * @author butterfly
 */
public class ValueModel {

    /**
     * 该热key创建时间
     */
    private long createTime = SystemClock.now();

    /**
     * 本地缓存时间，单位秒
     */
    private int expireSec;

    /**
     * 用户实际存放的value
     */
    private Object value;

    public static ValueModel of(Object value, int expireSec) {
        ValueModel valueModel = new ValueModel();
        valueModel.setExpireSec(expireSec);
        valueModel.setValue(value);
        return valueModel;
    }

    public long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(long createTime) {
        this.createTime = createTime;
    }

    public int getExpireSec() {
        return expireSec;
    }

    public void setExpireSec(int expireSec) {
        this.expireSec = expireSec;
    }

    public Object getValue() {
        return value;
    }

    public void setValue(Object value) {
        this.value = value;
    }
}
